package com.moniteach.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.moniteach.Prefs;
import com.moniteach.R;
import com.moniteach.activity.list.ListGroupActivity;
import com.moniteach.activity.list.ListMessageActivity;
import com.moniteach.activity.list.ListPredmetActivity;

public class MoniteachActivity extends CommonActivity {
	private Prefs prefs = Prefs.getInstance();

	@Override
	protected void onStop() {
		super.onStop();
		prefs.commit();
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		prefs.setContext(this);
		setContentView(R.layout.main);
	}

	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		// case R.id.mSettings:
		// // startActivity(new Intent(this, SettingsActivity.class));
		// return true;
		case R.id.mExit:
			prefs.clear();
			finish();
			return true;
		}
		return false;
	}

	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.menu, menu);
		return true;
	}

	public void clickMessages(View v) {
		Intent intent = new Intent(MoniteachActivity.this,
				ListMessageActivity.class);
		startActivity(intent);
	}

	public void clickGroups(View v) {
		Intent intent = new Intent(MoniteachActivity.this,
				ListGroupActivity.class);
		startActivity(intent);
	}

	public void clickPredmets(View v) {
		Intent intent = new Intent(MoniteachActivity.this,
				ListPredmetActivity.class);
		startActivity(intent);
	}

	public void clickProfile(View v) {
		Intent intent = new Intent(MoniteachActivity.this,
				ProfileActivity.class);
		startActivity(intent);
	}

	@Override
	protected void initForm() {

	}

	@Override
	protected String getTitlePage() {
		return null;
	}

}